#include<bits/stdc++.h>
using namespace std;
struct node{
	int num,cnt,vis;
}b[100005];
int a[100005];
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+1+n);
	int idx=0;
	for(int i=1;i<=n;i++)
	{
		if(a[i]!=a[i-1])
		{
			idx++,b[idx].num=a[i],b[idx].cnt=1,b[idx].vis=1;
		}
		else b[idx].cnt++,b[idx].vis++;
	}
	//for(int i=1;i<=idx;i++) cout<<b[i].num<<" "<<b[i].cnt<<" "<<b[i].vis<<endl;
	int i=1;
	for(int k=1;k<=100000;k++)
	{
		if(b[i].cnt)
		{
			for(int j=i+1;j<=idx;j++)
			{
				if(b[j].vis)
				{
					b[j].vis--,b[i].cnt--;
					break;
				}
			}
		}
		if(b[i].cnt==0) i++;
	}
	int ans=0;
	for(int i=1;i<=idx;i++)
	{
		ans+=b[i].cnt;
	}
	cout<<ans<<endl;
	return 0;
}
